<template>
  <div>
    <el-form-item label="选择组件" prop="type">
      <el-select v-model="form.widgetId">
        <el-option v-for="w in widgetStore" :label="w.uuid" :value="w.uuid" :key="w.uuid"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="调用方法" prop="type">
      <el-input v-model="form.methodName"></el-input>
    </el-form-item>
  </div>

</template>
<script>
  import handler from './handler'
  import vpd from '../../designer/mixins/vpd';

  export default {
    mixins: [vpd],
    name: 'vpd-widget-method',
    title: '组件方法调用',
    handler: handler,
    props: {
      data: {
        type: Object
      }
    },
    data() {
      return {

        form: {
          url: ''
        }
      }
    },
    computed: {
      widgetStore() {
        return this.$vpd.state.widgets;
      },
    },
    beforeMount() {
      Object.assign(this.form, this.data);
    },
    methods: {
      getForm() {
        return this.form;
      }
    }
  }
</script>
